<link href="lib/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style28 {color: #FFFFFF; }
.style29 {color: #009933}
-->
.add-bk{
   background: none repeat scroll 0 0 #ddd;
    border: 1px solid #ccc;
    margin: -77px 0 0 537px;
    padding: 4px 1em;
    position: absolute;
}
</style>
<script type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<div class="page-header">
  <h1><i class="fa fa-book"></i> Buku Tamu</h1>
</div>
<a href="?act=isi_tamu" class="add-bk"><span class="linkuri_bottom2"><i class="fa fa-pencil"></i> Isi Buku Tamu</span></a> 
               
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="grd">
  <tr>
    <td valign="top"><table width="100%" border="1" align="center" style="border-collapse: collapse;" bordercolor="#cccccc">
  <tr bgcolor="#660066" class="FOOTWARNA">
    <td id="tdUp"><div align="center" class="style28">Nama</div></td>
    <td id="tdUp"><div align="center" class="style28">Judul</div></td>
    <td id="tdUp"><div align="center" class="style28">Email</div></td>
    <td id="tdUp"><div align="center" class="style28">Pesan</div></td>
    </tr>
  <tr>
<? include"koneksi/koneksi.php";
 $limit=15;
 if(empty($halaman)){
 $offset=0;
 $halaman=1;}
 else{
 $offset=($halaman-1) * $limit; }
 $lihat=mysql_query("select * from buku_tamu order by id_tamu desc limit $offset,$limit");
 while($hs=mysql_fetch_array($lihat))
 {
 	if($j==0){
	echo"<tr id='tampil'>";
	$j++;}
	else{
	echo"<tr id='tampil2'>";
	$j--;}
	$no++;
?> 
    <td><div align="left"><? echo"$hs[nm_tamu]"; ?></div><div align="left"></div></td>
    <td><div align="left"><? echo"$hs[judul]"; ?></div></td>
    <td><div align="left"><? echo"$hs[email]"; ?></div></td>
    <td><div align="left"><? echo"$hs[pesan]"; ?></div></td>
    </tr>
  <? } ?>
</table>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="style12">
  <tr>
    <td><?
$lihat2=mysql_query("select * from buku_tamu order by id_tamu desc");
$jumbaris=mysql_num_rows($lihat2);
$total_halaman=ceil($jumbaris/$limit);
if(!empty($halaman) && $halaman!=1)
	{
	$previous=$halaman-1;
	echo"<a href=?act=buku_tamu&halaman=$previous>Previous</a> -";
	}
	else{
	echo"Previous -";
	}

for($i=1;$i<=$total_halaman;$i++)
if($i!=$halaman)
	{
	echo"<a href=?act=buku_tamu&halaman=$i>$i</a> -";
	}
	else{
	echo"$i -"; }

if($halaman<$total_halaman)
	{
	$next=$halaman+1;
	echo"<a href=?act=buku_tamu&halaman=$next>Next</a>";
	echo"<center>Jumlah Data : $jumbaris</center>"; }
	else{
	echo"Next";
	echo"<center>Jumlah Data : $jumbaris</center>"; }
?>    </td>
  </tr>
</table>	</td>
  </tr>
  <tr>
    <td><p>&nbsp;</p></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
